function ICBCRsa() {
  //RSA
}
//得到公钥，返回加密的字符串encryption
ICBCRsa.prototype.getPublicKey = function (param, callback) {

  /*$.ajax({
   url: "/ajaxpro/UairB2C.b2c.RsaTool,UairB2C.ashx",
   data: {},
   dataType: "html",
   headers: {"X-AjaxPro-Method": "GetRsaEntity"},
   type: "POST",
   success: function (rsaPub) {
   rsaPub = JSON.parse(rsaPub);
   var n_str = rsaPub.value.Modulus;//公钥
   var e_str = rsaPub.value.Exponent;//输入的字符串
   var n = pidCryptUtil.convertToHex(pidCryptUtil.decodeBase64(n_str));
   var e = pidCryptUtil.convertToHex(pidCryptUtil.decodeBase64(e_str));
   var rsa = new pidCrypt.RSA();
   rsa.setPublic(n, e, 16);
   //加密消息
   crypted = rsa.encrypt(param);
   var result = pidCryptUtil.encodeBase64(pidCryptUtil.convertFromHex(crypted));

   //返回结果
   callback(result);
   },
   error: function (a, b, c) {
   alert("系统错误，请重试");
   }
   });*/

  AJAX_POST(AJAX_PRO_RSA, '', function (err, rs) {
    // console.log('ICBCRsa', rs);
    rs = JSON.parse(rs);
    var n_str = rs.value.Modulus;//公钥
    var e_str = rs.value.Exponent;//输入的字符串
    var n = pidCryptUtil.convertToHex(pidCryptUtil.decodeBase64(n_str));
    var e = pidCryptUtil.convertToHex(pidCryptUtil.decodeBase64(e_str));
    var rsa = new pidCrypt.RSA();
    rsa.setPublic(n, e, 16);
    //加密消息
    crypted = rsa.encrypt(param);
    var result = pidCryptUtil.encodeBase64(pidCryptUtil.convertFromHex(crypted));

    //返回结果
    callback(result);
  }, PUBLIC_PARAM.rsa);
};

function ICBCAes() {
  //AES
}
ICBCAes.prototype.GetAesStr = function (param, callback) {
  var aesPwd = "我的密码";
  aesPwd = Math.random().toString(36).substr(2, 16);
  if (aesPwd.length < 16) {
    //alert("不足16位，补齐之前：" + aesPwd);
    for (var i = aesPwd.length; i < 16; i++) {
      aesPwd = aesPwd + "0";
    }
    //alert("足16位，补齐之后：" + aesPwd);
  }
  var rsaICBC = new ICBCRsa();
  rsaICBC.getPublicKey(aesPwd, function (encryptionPwd) {
    var key = aesPwd;  //密钥
    var key2 = key;
    //先固定起
    var iv = "3gqv4fpz2i0ms4i0";
    var iv2 = iv;
    key = CryptoJS.enc.Utf8.parse(key);
    iv = CryptoJS.enc.Utf8.parse(iv);
    var options = {
      iv: iv,
      keySize: 128 / 8,
      mode: CryptoJS.mode.CBC,
      padding: CryptoJS.pad.Pkcs7
    };

    param = CryptoJS.enc.Utf8.parse(param);
    var addrAes = CryptoJS.AES.encrypt(param, key, options);//密文
    addrAes = encodeURIComponent(addrAes);

    callback(addrAes, encryptionPwd);
  });
}